Optimal. Leaf size=299 \[ -\frac {\left (\frac {1}{16}-\frac {3 i}{16}\right ) \sqrt {d} \text {ArcTan}\left (1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 f}+\frac {\left (\frac {1}{16}-\frac {3 i}{16}\right ) \sqrt {d} \text {ArcTan}\left (1+\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 f}+\frac {\left (\frac {1}{32}+\frac {3 i}{32}\right ) \sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 f}-\frac {\left (\frac {1}{32}+\frac {3 i}{32}\right ) \sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 f}+\frac {i \sqrt {d \tan (e+f x)}}{8 a^2 f (1+i \tan (e+f x))}+\frac {i \sqrt {d \tan (e+f x)}}{4 f (a+i a \tan (e+f x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.25, antiderivative size = 299, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 9, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.321, Rules used = {3638, 3677,
3615, 1182, 1176, 631, 210, 1179, 642} \begin {gather*} -\frac {\left (\frac {1}{16}-\frac {3 i}{16}\right ) \sqrt {d} \text {ArcTan}\left (1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 f}+\frac {\left (\frac {1}{16}-\frac {3 i}{16}\right ) \sqrt {d} \text {ArcTan}\left (\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}+1\right )}{\sqrt {2} a^2 f}+\frac {i \sqrt {d \tan (e+f x)}}{8 a^2 f (1+i \tan (e+f x))}+\frac {\left (\frac {1}{32}+\frac {3 i}{32}\right ) \sqrt {d} \log \left (\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}+\sqrt {d}\right )}{\sqrt {2} a^2 f}-\frac {\left (\frac {1}{32}+\frac {3 i}{32}\right ) \sqrt {d} \log \left (\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}+\sqrt {d}\right )}{\sqrt {2} a^2 f}+\frac {i \sqrt {d \tan (e+f x)}}{4 f (a+i a \tan (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 631
Rule 642
Rule 1176
Rule 1179
Rule 1182
Rule 3615
Rule 3638
Rule 3677
Rubi steps
\begin {align*} \int \frac {\sqrt {d \tan (e+f x)}}{(a+i a \tan (e+f x))^2} \, dx &=\frac {i \sqrt {d \tan (e+f x)}}{4 f (a+i a \tan (e+f x))^2}-\frac {\int \frac {i a d-3 a d \tan (e+f x)}{\sqrt {d \tan (e+f x)} (a+i a \tan (e+f x))} \, dx}{8 a^2}\\ &=\frac {i \sqrt {d \tan (e+f x)}}{8 a^2 f (1+i \tan (e+f x))}+\frac {i \sqrt {d \tan (e+f x)}}{4 f (a+i a \tan (e+f x))^2}-\frac {\int \frac {3 i a^2 d^2-a^2 d^2 \tan (e+f x)}{\sqrt {d \tan (e+f x)}} \, dx}{16 a^4 d}\\ &=\frac {i \sqrt {d \tan (e+f x)}}{8 a^2 f (1+i \tan (e+f x))}+\frac {i \sqrt {d \tan (e+f x)}}{4 f (a+i a \tan (e+f x))^2}-\frac {\text {Subst}\left (\int \frac {3 i a^2 d^3-a^2 d^2 x^2}{d^2+x^4} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{8 a^4 d f}\\ &=\frac {i \sqrt {d \tan (e+f x)}}{8 a^2 f (1+i \tan (e+f x))}+\frac {i \sqrt {d \tan (e+f x)}}{4 f (a+i a \tan (e+f x))^2}--\frac {\left (\left (\frac {1}{16}-\frac {3 i}{16}\right ) d\right ) \text {Subst}\left (\int \frac {d+x^2}{d^2+x^4} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{a^2 f}-\frac {\left (\left (\frac {1}{16}+\frac {3 i}{16}\right ) d\right ) \text {Subst}\left (\int \frac {d-x^2}{d^2+x^4} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{a^2 f}\\ &=\frac {i \sqrt {d \tan (e+f x)}}{8 a^2 f (1+i \tan (e+f x))}+\frac {i \sqrt {d \tan (e+f x)}}{4 f (a+i a \tan (e+f x))^2}--\frac {\left (\left (\frac {1}{32}+\frac {3 i}{32}\right ) \sqrt {d}\right ) \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {d}+2 x}{-d-\sqrt {2} \sqrt {d} x-x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 f}--\frac {\left (\left (\frac {1}{32}+\frac {3 i}{32}\right ) \sqrt {d}\right ) \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {d}-2 x}{-d+\sqrt {2} \sqrt {d} x-x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 f}--\frac {\left (\left (\frac {1}{32}-\frac {3 i}{32}\right ) d\right ) \text {Subst}\left (\int \frac {1}{d-\sqrt {2} \sqrt {d} x+x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{a^2 f}--\frac {\left (\left (\frac {1}{32}-\frac {3 i}{32}\right ) d\right ) \text {Subst}\left (\int \frac {1}{d+\sqrt {2} \sqrt {d} x+x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{a^2 f}\\ &=\frac {\left (\frac {1}{32}+\frac {3 i}{32}\right ) \sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 f}-\frac {\left (\frac {1}{32}+\frac {3 i}{32}\right ) \sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 f}+\frac {i \sqrt {d \tan (e+f x)}}{8 a^2 f (1+i \tan (e+f x))}+\frac {i \sqrt {d \tan (e+f x)}}{4 f (a+i a \tan (e+f x))^2}--\frac {\left (\left (\frac {1}{16}-\frac {3 i}{16}\right ) \sqrt {d}\right ) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 f}-\frac {\left (\left (\frac {1}{16}-\frac {3 i}{16}\right ) \sqrt {d}\right ) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 f}\\ &=-\frac {\left (\frac {1}{16}-\frac {3 i}{16}\right ) \sqrt {d} \tan ^{-1}\left (1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 f}+\frac {\left (\frac {1}{16}-\frac {3 i}{16}\right ) \sqrt {d} \tan ^{-1}\left (1+\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 f}+\frac {\left (\frac {1}{32}+\frac {3 i}{32}\right ) \sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 f}-\frac {\left (\frac {1}{32}+\frac {3 i}{32}\right ) \sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 f}+\frac {i \sqrt {d \tan (e+f x)}}{8 a^2 f (1+i \tan (e+f x))}+\frac {i \sqrt {d \tan (e+f x)}}{4 f (a+i a \tan (e+f x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.95, size = 227, normalized size = 0.76 \begin {gather*} -\frac {d \sec ^3(e+f x) \left (-\cos (e+f x)+\cos (3 (e+f x))+3 i \sin (e+f x)-(1+3 i) \cos (2 (e+f x)) \log \left (\cos (e+f x)+\sin (e+f x)+\sqrt {\sin (2 (e+f x))}\right ) \sqrt {\sin (2 (e+f x))}+(3-i) \log \left (\cos (e+f x)+\sin (e+f x)+\sqrt {\sin (2 (e+f x))}\right ) \sin ^{\frac {3}{2}}(2 (e+f x))-(3+i) \text {ArcSin}(\cos (e+f x)-\sin (e+f x)) \sqrt {\sin (2 (e+f x))} (-i \cos (2 (e+f x))+\sin (2 (e+f x)))+3 i \sin (3 (e+f x))\right )}{32 a^2 f \sqrt {d \tan (e+f x)} (-i+\tan (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.19, size = 116, normalized size = 0.39
method | result | size |
derivativedivides | \(\frac {2 d^{3} \left (-\frac {\frac {\frac {\left (d \tan \left (f x +e \right )\right )^{\frac {3}{2}}}{2}-\frac {3 i d \sqrt {d \tan \left (f x +e \right )}}{2}}{\left (i d \tan \left (f x +e \right )+d \right )^{2}}+\frac {\arctan \left (\frac {\sqrt {d \tan \left (f x +e \right )}}{\sqrt {-i d}}\right )}{2 \sqrt {-i d}}}{8 d^{2}}+\frac {\arctan \left (\frac {\sqrt {d \tan \left (f x +e \right )}}{\sqrt {i d}}\right )}{8 d^{2} \sqrt {i d}}\right )}{f \,a^{2}}\) | \(116\) |
default | \(\frac {2 d^{3} \left (-\frac {\frac {\frac {\left (d \tan \left (f x +e \right )\right )^{\frac {3}{2}}}{2}-\frac {3 i d \sqrt {d \tan \left (f x +e \right )}}{2}}{\left (i d \tan \left (f x +e \right )+d \right )^{2}}+\frac {\arctan \left (\frac {\sqrt {d \tan \left (f x +e \right )}}{\sqrt {-i d}}\right )}{2 \sqrt {-i d}}}{8 d^{2}}+\frac {\arctan \left (\frac {\sqrt {d \tan \left (f x +e \right )}}{\sqrt {i d}}\right )}{8 d^{2} \sqrt {i d}}\right )}{f \,a^{2}}\) | \(116\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 563 vs. \(2 (225) = 450\).
time = 0.39, size = 563, normalized size = 1.88 \begin {gather*} -\frac {{\left (4 \, a^{2} f \sqrt {\frac {i \, d}{16 \, a^{4} f^{2}}} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (-2 \, {\left (4 \, {\left (i \, a^{2} f e^{\left (2 i \, f x + 2 i \, e\right )} + i \, a^{2} f\right )} \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {i \, d}{16 \, a^{4} f^{2}}} + i \, d e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}\right ) - 4 \, a^{2} f \sqrt {\frac {i \, d}{16 \, a^{4} f^{2}}} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (-2 \, {\left (4 \, {\left (-i \, a^{2} f e^{\left (2 i \, f x + 2 i \, e\right )} - i \, a^{2} f\right )} \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {i \, d}{16 \, a^{4} f^{2}}} + i \, d e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}\right ) - 4 \, a^{2} f \sqrt {-\frac {i \, d}{64 \, a^{4} f^{2}}} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (\frac {{\left (8 \, {\left (a^{2} f e^{\left (2 i \, f x + 2 i \, e\right )} + a^{2} f\right )} \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {i \, d}{64 \, a^{4} f^{2}}} + d\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{8 \, a^{2} f}\right ) + 4 \, a^{2} f \sqrt {-\frac {i \, d}{64 \, a^{4} f^{2}}} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (-\frac {{\left (8 \, {\left (a^{2} f e^{\left (2 i \, f x + 2 i \, e\right )} + a^{2} f\right )} \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {i \, d}{64 \, a^{4} f^{2}}} - d\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{8 \, a^{2} f}\right ) - \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} {\left (2 i \, e^{\left (4 i \, f x + 4 i \, e\right )} + 3 i \, e^{\left (2 i \, f x + 2 i \, e\right )} + i\right )}\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{16 \, a^{2} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {\int \frac {\sqrt {d \tan {\left (e + f x \right )}}}{\tan ^{2}{\left (e + f x \right )} - 2 i \tan {\left (e + f x \right )} - 1}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.61, size = 205, normalized size = 0.69 \begin {gather*} \frac {\frac {i \, \sqrt {2} d^{\frac {3}{2}} \arctan \left (-\frac {8 i \, \sqrt {d^{2}} \sqrt {d \tan \left (f x + e\right )}}{4 i \, \sqrt {2} d^{\frac {3}{2}} + 4 \, \sqrt {2} \sqrt {d^{2}} \sqrt {d}}\right )}{a^{2} f {\left (\frac {i \, d}{\sqrt {d^{2}}} + 1\right )}} - \frac {2 i \, \sqrt {2} d^{\frac {3}{2}} \arctan \left (-\frac {8 i \, \sqrt {d^{2}} \sqrt {d \tan \left (f x + e\right )}}{-4 i \, \sqrt {2} d^{\frac {3}{2}} + 4 \, \sqrt {2} \sqrt {d^{2}} \sqrt {d}}\right )}{a^{2} f {\left (-\frac {i \, d}{\sqrt {d^{2}}} + 1\right )}} + \frac {\sqrt {d \tan \left (f x + e\right )} d^{3} \tan \left (f x + e\right ) - 3 i \, \sqrt {d \tan \left (f x + e\right )} d^{3}}{{\left (d \tan \left (f x + e\right ) - i \, d\right )}^{2} a^{2} f}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.20, size = 147, normalized size = 0.49 \begin {gather*} \frac {-\frac {d\,{\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^{3/2}}{8\,a^2\,f}+\frac {d^2\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}\,3{}\mathrm {i}}{8\,a^2\,f}}{-d^2\,{\mathrm {tan}\left (e+f\,x\right )}^2+d^2\,\mathrm {tan}\left (e+f\,x\right )\,2{}\mathrm {i}+d^2}+\frac {\mathrm {atanh}\left (\frac {2\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {-\frac {d\,1{}\mathrm {i}}{4}}}{d}\right )\,\sqrt {-\frac {d\,1{}\mathrm {i}}{4}}}{4\,a^2\,f}-\frac {\mathrm {atanh}\left (\frac {4\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {\frac {d\,1{}\mathrm {i}}{16}}}{d}\right )\,\sqrt {\frac {d\,1{}\mathrm {i}}{16}}}{a^2\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________